<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - Lua 5.3.5 - src/lundump.c</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - lundump.c</td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">Lua 5.3.5</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">152</td>
            <td class="headerCovTableEntry">159</td>
            <td class="headerCovTableEntryHi">95.6 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2019-06-13 19:44:17</td>
            <td></td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<span class="lineNum">       1 </span>            : /*
<span class="lineNum">       2 </span>            : ** $Id: lundump.c,v 2.44.1.1 2017/04/19 17:20:42 roberto Exp $
<span class="lineNum">       3 </span>            : ** load precompiled Lua chunks
<span class="lineNum">       4 </span>            : ** See Copyright Notice in lua.h
<span class="lineNum">       5 </span>            : */
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span>            : #define lundump_c
<span class="lineNum">       8 </span>            : #define LUA_CORE
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span>            : #include &quot;lprefix.h&quot;
<span class="lineNum">      11 </span>            : 
<span class="lineNum">      12 </span>            : 
<span class="lineNum">      13 </span>            : #include &lt;string.h&gt;
<span class="lineNum">      14 </span>            : 
<span class="lineNum">      15 </span>            : #include &quot;lua.h&quot;
<span class="lineNum">      16 </span>            : 
<span class="lineNum">      17 </span>            : #include &quot;ldebug.h&quot;
<span class="lineNum">      18 </span>            : #include &quot;ldo.h&quot;
<span class="lineNum">      19 </span>            : #include &quot;lfunc.h&quot;
<span class="lineNum">      20 </span>            : #include &quot;lmem.h&quot;
<span class="lineNum">      21 </span>            : #include &quot;lobject.h&quot;
<span class="lineNum">      22 </span>            : #include &quot;lstring.h&quot;
<span class="lineNum">      23 </span>            : #include &quot;lundump.h&quot;
<span class="lineNum">      24 </span>            : #include &quot;lzio.h&quot;
<span class="lineNum">      25 </span>            : 
<span class="lineNum">      26 </span>            : 
<span class="lineNum">      27 </span>            : #if !defined(luai_verifycode)
<span class="lineNum">      28 </span>            : #define luai_verifycode(L,b,f)  /* empty */
<span class="lineNum">      29 </span>            : #endif
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : 
<span class="lineNum">      32 </span>            : typedef struct {
<span class="lineNum">      33 </span>            :   lua_State *L;
<span class="lineNum">      34 </span>            :   ZIO *Z;
<span class="lineNum">      35 </span>            :   const char *name;
<span class="lineNum">      36 </span>            : } LoadState;
<span class="lineNum">      37 </span>            : 
<span class="lineNum">      38 </span>            : 
<span class="lineNum">      39 </span><span class="lineCov">          8 : static l_noret error(LoadState *S, const char *why) {</span>
<span class="lineNum">      40 </span><span class="lineCov">          8 :   luaO_pushfstring(S-&gt;L, &quot;%s: %s precompiled chunk&quot;, S-&gt;name, why);</span>
<span class="lineNum">      41 </span><span class="lineCov">          8 :   luaD_throw(S-&gt;L, LUA_ERRSYNTAX);</span>
<span class="lineNum">      42 </span>            : }
<span class="lineNum">      43 </span>            : 
<span class="lineNum">      44 </span>            : 
<span class="lineNum">      45 </span>            : /*
<span class="lineNum">      46 </span>            : ** All high-level loads go through LoadVector; you can change it to
<span class="lineNum">      47 </span>            : ** adapt to the endianness of the input
<span class="lineNum">      48 </span>            : */
<span class="lineNum">      49 </span>            : #define LoadVector(S,b,n)       LoadBlock(S,b,(n)*sizeof((b)[0]))
<span class="lineNum">      50 </span>            : 
<span class="lineNum">      51 </span><span class="lineCov">        480 : static void LoadBlock (LoadState *S, void *b, size_t size) {</span>
<span class="lineNum">      52 </span><span class="lineCov">        480 :   if (luaZ_read(S-&gt;Z, b, size) != 0)</span>
<span class="lineNum">      53 </span><span class="lineCov">          1 :     error(S, &quot;truncated&quot;);</span>
<span class="lineNum">      54 </span><span class="lineCov">        479 : }</span>
<span class="lineNum">      55 </span>            : 
<span class="lineNum">      56 </span>            : 
<span class="lineNum">      57 </span>            : #define LoadVar(S,x)            LoadVector(S,&amp;x,1)
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span>            : 
<span class="lineNum">      60 </span><span class="lineCov">        241 : static lu_byte LoadByte (LoadState *S) {</span>
<span class="lineNum">      61 </span>            :   lu_byte x;
<span class="lineNum">      62 </span><span class="lineCov">        241 :   LoadVar(S, x);</span>
<span class="lineNum">      63 </span><span class="lineCov">        241 :   return x;</span>
<span class="lineNum">      64 </span>            : }
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span>            : 
<span class="lineNum">      67 </span><span class="lineCov">        115 : static int LoadInt (LoadState *S) {</span>
<span class="lineNum">      68 </span>            :   int x;
<span class="lineNum">      69 </span><span class="lineCov">        115 :   LoadVar(S, x);</span>
<span class="lineNum">      70 </span><span class="lineCov">        115 :   return x;</span>
<span class="lineNum">      71 </span>            : }
<span class="lineNum">      72 </span>            : 
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span><span class="lineCov">         10 : static lua_Number LoadNumber (LoadState *S) {</span>
<span class="lineNum">      75 </span>            :   lua_Number x;
<span class="lineNum">      76 </span><span class="lineCov">         10 :   LoadVar(S, x);</span>
<span class="lineNum">      77 </span><span class="lineCov">         10 :   return x;</span>
<span class="lineNum">      78 </span>            : }
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span>            : 
<span class="lineNum">      81 </span><span class="lineCov">         11 : static lua_Integer LoadInteger (LoadState *S) {</span>
<span class="lineNum">      82 </span>            :   lua_Integer x;
<span class="lineNum">      83 </span><span class="lineCov">         11 :   LoadVar(S, x);</span>
<span class="lineNum">      84 </span><span class="lineCov">         11 :   return x;</span>
<span class="lineNum">      85 </span>            : }
<span class="lineNum">      86 </span>            : 
<span class="lineNum">      87 </span>            : 
<span class="lineNum">      88 </span><span class="lineCov">         60 : static TString *LoadString (LoadState *S) {</span>
<span class="lineNum">      89 </span><span class="lineCov">         60 :   size_t size = LoadByte(S);</span>
<span class="lineNum">      90 </span><span class="lineCov">         60 :   if (size == 0xFF)</span>
<span class="lineNum">      91 </span><span class="lineNoCov">          0 :     LoadVar(S, size);</span>
<span class="lineNum">      92 </span><span class="lineCov">         60 :   if (size == 0)</span>
<span class="lineNum">      93 </span><span class="lineCov">          6 :     return NULL;</span>
<span class="lineNum">      94 </span><span class="lineCov">         54 :   else if (--size &lt;= LUAI_MAXSHORTLEN) {  /* short string? */</span>
<span class="lineNum">      95 </span>            :     char buff[LUAI_MAXSHORTLEN];
<span class="lineNum">      96 </span><span class="lineCov">         54 :     LoadVector(S, buff, size);</span>
<span class="lineNum">      97 </span><span class="lineCov">         54 :     return luaS_newlstr(S-&gt;L, buff, size);</span>
<span class="lineNum">      98 </span>            :   }
<span class="lineNum">      99 </span>            :   else {  /* long string */
<span class="lineNum">     100 </span><span class="lineNoCov">          0 :     TString *ts = luaS_createlngstrobj(S-&gt;L, size);</span>
<span class="lineNum">     101 </span><span class="lineNoCov">          0 :     LoadVector(S, getstr(ts), size);  /* load directly in final place */</span>
<span class="lineNum">     102 </span><span class="lineNoCov">          0 :     return ts;</span>
<span class="lineNum">     103 </span>            :   }
<span class="lineNum">     104 </span>            : }
<span class="lineNum">     105 </span>            : 
<span class="lineNum">     106 </span>            : 
<span class="lineNum">     107 </span><span class="lineCov">         11 : static void LoadCode (LoadState *S, Proto *f) {</span>
<span class="lineNum">     108 </span><span class="lineCov">         11 :   int n = LoadInt(S);</span>
<span class="lineNum">     109 </span><span class="lineCov">         11 :   f-&gt;code = luaM_newvector(S-&gt;L, n, Instruction);</span>
<span class="lineNum">     110 </span><span class="lineCov">         11 :   f-&gt;sizecode = n;</span>
<span class="lineNum">     111 </span><span class="lineCov">         11 :   LoadVector(S, f-&gt;code, n);</span>
<span class="lineNum">     112 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     113 </span>            : 
<span class="lineNum">     114 </span>            : 
<span class="lineNum">     115 </span>            : static void LoadFunction(LoadState *S, Proto *f, TString *psource);
<span class="lineNum">     116 </span>            : 
<span class="lineNum">     117 </span>            : 
<span class="lineNum">     118 </span><span class="lineCov">         11 : static void LoadConstants (LoadState *S, Proto *f) {</span>
<span class="lineNum">     119 </span>            :   int i;
<span class="lineNum">     120 </span><span class="lineCov">         11 :   int n = LoadInt(S);</span>
<span class="lineNum">     121 </span><span class="lineCov">         11 :   f-&gt;k = luaM_newvector(S-&gt;L, n, TValue);</span>
<span class="lineNum">     122 </span><span class="lineCov">         11 :   f-&gt;sizek = n;</span>
<span class="lineNum">     123 </span><span class="lineCov">         51 :   for (i = 0; i &lt; n; i++)</span>
<span class="lineNum">     124 </span><span class="lineCov">         40 :     setnilvalue(&amp;f-&gt;k[i]);</span>
<span class="lineNum">     125 </span><span class="lineCov">         51 :   for (i = 0; i &lt; n; i++) {</span>
<span class="lineNum">     126 </span><span class="lineCov">         40 :     TValue *o = &amp;f-&gt;k[i];</span>
<span class="lineNum">     127 </span><span class="lineCov">         40 :     int t = LoadByte(S);</span>
<span class="lineNum">     128 </span><span class="lineCov">         40 :     switch (t) {</span>
<span class="lineNum">     129 </span><span class="lineCov">          2 :     case LUA_TNIL:</span>
<span class="lineNum">     130 </span><span class="lineCov">          2 :       setnilvalue(o);</span>
<span class="lineNum">     131 </span><span class="lineCov">          2 :       break;</span>
<span class="lineNum">     132 </span><span class="lineCov">          2 :     case LUA_TBOOLEAN:</span>
<span class="lineNum">     133 </span><span class="lineCov">          2 :       setbvalue(o, LoadByte(S));</span>
<span class="lineNum">     134 </span><span class="lineCov">          2 :       break;</span>
<span class="lineNum">     135 </span><span class="lineCov">          2 :     case LUA_TNUMFLT:</span>
<span class="lineNum">     136 </span><span class="lineCov">          2 :       setfltvalue(o, LoadNumber(S));</span>
<span class="lineNum">     137 </span><span class="lineCov">          2 :       break;</span>
<span class="lineNum">     138 </span><span class="lineCov">          2 :     case LUA_TNUMINT:</span>
<span class="lineNum">     139 </span><span class="lineCov">          2 :       setivalue(o, LoadInteger(S));</span>
<span class="lineNum">     140 </span><span class="lineCov">          2 :       break;</span>
<span class="lineNum">     141 </span><span class="lineCov">         32 :     case LUA_TSHRSTR:</span>
<span class="lineNum">     142 </span>            :     case LUA_TLNGSTR:
<span class="lineNum">     143 </span><span class="lineCov">         32 :       setsvalue2n(S-&gt;L, o, LoadString(S));</span>
<span class="lineNum">     144 </span><span class="lineCov">         32 :       break;</span>
<span class="lineNum">     145 </span><span class="lineCov">         40 :     default:</span>
<span class="lineNum">     146 </span>            :       lua_assert(0);
<span class="lineNum">     147 </span>            :     }
<span class="lineNum">     148 </span>            :   }
<span class="lineNum">     149 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     150 </span>            : 
<span class="lineNum">     151 </span>            : 
<span class="lineNum">     152 </span><span class="lineCov">         11 : static void LoadProtos (LoadState *S, Proto *f) {</span>
<span class="lineNum">     153 </span>            :   int i;
<span class="lineNum">     154 </span><span class="lineCov">         11 :   int n = LoadInt(S);</span>
<span class="lineNum">     155 </span><span class="lineCov">         11 :   f-&gt;p = luaM_newvector(S-&gt;L, n, Proto *);</span>
<span class="lineNum">     156 </span><span class="lineCov">         11 :   f-&gt;sizep = n;</span>
<span class="lineNum">     157 </span><span class="lineCov">         15 :   for (i = 0; i &lt; n; i++)</span>
<span class="lineNum">     158 </span><span class="lineCov">          4 :     f-&gt;p[i] = NULL;</span>
<span class="lineNum">     159 </span><span class="lineCov">         15 :   for (i = 0; i &lt; n; i++) {</span>
<span class="lineNum">     160 </span><span class="lineCov">          4 :     f-&gt;p[i] = luaF_newproto(S-&gt;L);</span>
<span class="lineNum">     161 </span><span class="lineCov">          4 :     LoadFunction(S, f-&gt;p[i], f-&gt;source);</span>
<span class="lineNum">     162 </span>            :   }
<span class="lineNum">     163 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     164 </span>            : 
<span class="lineNum">     165 </span>            : 
<span class="lineNum">     166 </span><span class="lineCov">         11 : static void LoadUpvalues (LoadState *S, Proto *f) {</span>
<span class="lineNum">     167 </span>            :   int i, n;
<span class="lineNum">     168 </span><span class="lineCov">         11 :   n = LoadInt(S);</span>
<span class="lineNum">     169 </span><span class="lineCov">         11 :   f-&gt;upvalues = luaM_newvector(S-&gt;L, n, Upvaldesc);</span>
<span class="lineNum">     170 </span><span class="lineCov">         11 :   f-&gt;sizeupvalues = n;</span>
<span class="lineNum">     171 </span><span class="lineCov">         24 :   for (i = 0; i &lt; n; i++)</span>
<span class="lineNum">     172 </span><span class="lineCov">         13 :     f-&gt;upvalues[i].name = NULL;</span>
<span class="lineNum">     173 </span><span class="lineCov">         24 :   for (i = 0; i &lt; n; i++) {</span>
<span class="lineNum">     174 </span><span class="lineCov">         13 :     f-&gt;upvalues[i].instack = LoadByte(S);</span>
<span class="lineNum">     175 </span><span class="lineCov">         13 :     f-&gt;upvalues[i].idx = LoadByte(S);</span>
<span class="lineNum">     176 </span>            :   }
<span class="lineNum">     177 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     178 </span>            : 
<span class="lineNum">     179 </span>            : 
<span class="lineNum">     180 </span><span class="lineCov">         11 : static void LoadDebug (LoadState *S, Proto *f) {</span>
<span class="lineNum">     181 </span>            :   int i, n;
<span class="lineNum">     182 </span><span class="lineCov">         11 :   n = LoadInt(S);</span>
<span class="lineNum">     183 </span><span class="lineCov">         11 :   f-&gt;lineinfo = luaM_newvector(S-&gt;L, n, int);</span>
<span class="lineNum">     184 </span><span class="lineCov">         11 :   f-&gt;sizelineinfo = n;</span>
<span class="lineNum">     185 </span><span class="lineCov">         11 :   LoadVector(S, f-&gt;lineinfo, n);</span>
<span class="lineNum">     186 </span><span class="lineCov">         11 :   n = LoadInt(S);</span>
<span class="lineNum">     187 </span><span class="lineCov">         11 :   f-&gt;locvars = luaM_newvector(S-&gt;L, n, LocVar);</span>
<span class="lineNum">     188 </span><span class="lineCov">         11 :   f-&gt;sizelocvars = n;</span>
<span class="lineNum">     189 </span><span class="lineCov">         19 :   for (i = 0; i &lt; n; i++)</span>
<span class="lineNum">     190 </span><span class="lineCov">          8 :     f-&gt;locvars[i].varname = NULL;</span>
<span class="lineNum">     191 </span><span class="lineCov">         19 :   for (i = 0; i &lt; n; i++) {</span>
<span class="lineNum">     192 </span><span class="lineCov">          8 :     f-&gt;locvars[i].varname = LoadString(S);</span>
<span class="lineNum">     193 </span><span class="lineCov">          8 :     f-&gt;locvars[i].startpc = LoadInt(S);</span>
<span class="lineNum">     194 </span><span class="lineCov">          8 :     f-&gt;locvars[i].endpc = LoadInt(S);</span>
<span class="lineNum">     195 </span>            :   }
<span class="lineNum">     196 </span><span class="lineCov">         11 :   n = LoadInt(S);</span>
<span class="lineNum">     197 </span><span class="lineCov">         20 :   for (i = 0; i &lt; n; i++)</span>
<span class="lineNum">     198 </span><span class="lineCov">          9 :     f-&gt;upvalues[i].name = LoadString(S);</span>
<span class="lineNum">     199 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     200 </span>            : 
<span class="lineNum">     201 </span>            : 
<span class="lineNum">     202 </span><span class="lineCov">         11 : static void LoadFunction (LoadState *S, Proto *f, TString *psource) {</span>
<span class="lineNum">     203 </span><span class="lineCov">         11 :   f-&gt;source = LoadString(S);</span>
<span class="lineNum">     204 </span><span class="lineCov">         11 :   if (f-&gt;source == NULL)  /* no source in dump? */</span>
<span class="lineNum">     205 </span><span class="lineCov">          6 :     f-&gt;source = psource;  /* reuse parent's source */</span>
<span class="lineNum">     206 </span><span class="lineCov">         11 :   f-&gt;linedefined = LoadInt(S);</span>
<span class="lineNum">     207 </span><span class="lineCov">         11 :   f-&gt;lastlinedefined = LoadInt(S);</span>
<span class="lineNum">     208 </span><span class="lineCov">         11 :   f-&gt;numparams = LoadByte(S);</span>
<span class="lineNum">     209 </span><span class="lineCov">         11 :   f-&gt;is_vararg = LoadByte(S);</span>
<span class="lineNum">     210 </span><span class="lineCov">         11 :   f-&gt;maxstacksize = LoadByte(S);</span>
<span class="lineNum">     211 </span><span class="lineCov">         11 :   LoadCode(S, f);</span>
<span class="lineNum">     212 </span><span class="lineCov">         11 :   LoadConstants(S, f);</span>
<span class="lineNum">     213 </span><span class="lineCov">         11 :   LoadUpvalues(S, f);</span>
<span class="lineNum">     214 </span><span class="lineCov">         11 :   LoadProtos(S, f);</span>
<span class="lineNum">     215 </span><span class="lineCov">         11 :   LoadDebug(S, f);</span>
<span class="lineNum">     216 </span><span class="lineCov">         11 : }</span>
<span class="lineNum">     217 </span>            : 
<span class="lineNum">     218 </span>            : 
<span class="lineNum">     219 </span><span class="lineCov">         27 : static void checkliteral (LoadState *S, const char *s, const char *msg) {</span>
<span class="lineNum">     220 </span>            :   char buff[sizeof(LUA_SIGNATURE) + sizeof(LUAC_DATA)]; /* larger than both */
<span class="lineNum">     221 </span><span class="lineCov">         27 :   size_t len = strlen(s);</span>
<span class="lineNum">     222 </span><span class="lineCov">         27 :   LoadVector(S, buff, len);</span>
<span class="lineNum">     223 </span><span class="lineCov">         26 :   if (memcmp(s, buff, len) != 0)</span>
<span class="lineNum">     224 </span><span class="lineCov">          2 :     error(S, msg);</span>
<span class="lineNum">     225 </span><span class="lineCov">         24 : }</span>
<span class="lineNum">     226 </span>            : 
<span class="lineNum">     227 </span>            : 
<span class="lineNum">     228 </span><span class="lineCov">         46 : static void fchecksize (LoadState *S, size_t size, const char *tname) {</span>
<span class="lineNum">     229 </span><span class="lineCov">         46 :   if (LoadByte(S) != size)</span>
<span class="lineNum">     230 </span><span class="lineCov">          1 :     error(S, luaO_pushfstring(S-&gt;L, &quot;%s size mismatch in&quot;, tname));</span>
<span class="lineNum">     231 </span><span class="lineCov">         45 : }</span>
<span class="lineNum">     232 </span>            : 
<span class="lineNum">     233 </span>            : 
<span class="lineNum">     234 </span>            : #define checksize(S,t)  fchecksize(S,sizeof(t),#t)
<span class="lineNum">     235 </span>            : 
<span class="lineNum">     236 </span><span class="lineCov">         15 : static void checkHeader (LoadState *S) {</span>
<span class="lineNum">     237 </span><span class="lineCov">         15 :   checkliteral(S, LUA_SIGNATURE + 1, &quot;not a&quot;);  /* 1st char already checked */</span>
<span class="lineNum">     238 </span><span class="lineCov">         14 :   if (LoadByte(S) != LUAC_VERSION)</span>
<span class="lineNum">     239 </span><span class="lineCov">          1 :     error(S, &quot;version mismatch in&quot;);</span>
<span class="lineNum">     240 </span><span class="lineCov">         13 :   if (LoadByte(S) != LUAC_FORMAT)</span>
<span class="lineNum">     241 </span><span class="lineCov">          1 :     error(S, &quot;format mismatch in&quot;);</span>
<span class="lineNum">     242 </span><span class="lineCov">         12 :   checkliteral(S, LUAC_DATA, &quot;corrupted&quot;);</span>
<span class="lineNum">     243 </span><span class="lineCov">         10 :   checksize(S, int);</span>
<span class="lineNum">     244 </span><span class="lineCov">          9 :   checksize(S, size_t);</span>
<span class="lineNum">     245 </span><span class="lineCov">          9 :   checksize(S, Instruction);</span>
<span class="lineNum">     246 </span><span class="lineCov">          9 :   checksize(S, lua_Integer);</span>
<span class="lineNum">     247 </span><span class="lineCov">          9 :   checksize(S, lua_Number);</span>
<span class="lineNum">     248 </span><span class="lineCov">          9 :   if (LoadInteger(S) != LUAC_INT)</span>
<span class="lineNum">     249 </span><span class="lineCov">          1 :     error(S, &quot;endianness mismatch in&quot;);</span>
<span class="lineNum">     250 </span><span class="lineCov">          8 :   if (LoadNumber(S) != LUAC_NUM)</span>
<span class="lineNum">     251 </span><span class="lineCov">          1 :     error(S, &quot;float format mismatch in&quot;);</span>
<span class="lineNum">     252 </span><span class="lineCov">          7 : }</span>
<span class="lineNum">     253 </span>            : 
<span class="lineNum">     254 </span>            : 
<span class="lineNum">     255 </span>            : /*
<span class="lineNum">     256 </span>            : ** load precompiled chunk
<span class="lineNum">     257 </span>            : */
<span class="lineNum">     258 </span><span class="lineCov">         15 : LClosure *luaU_undump(lua_State *L, ZIO *Z, const char *name) {</span>
<span class="lineNum">     259 </span>            :   LoadState S;
<span class="lineNum">     260 </span>            :   LClosure *cl;
<span class="lineNum">     261 </span><span class="lineCov">         15 :   if (*name == '@' || *name == '=')</span>
<span class="lineNum">     262 </span><span class="lineCov">         15 :     S.name = name + 1;</span>
<span class="lineNum">     263 </span><span class="lineNoCov">          0 :   else if (*name == LUA_SIGNATURE[0])</span>
<span class="lineNum">     264 </span><span class="lineNoCov">          0 :     S.name = &quot;binary string&quot;;</span>
<span class="lineNum">     265 </span>            :   else
<span class="lineNum">     266 </span><span class="lineNoCov">          0 :     S.name = name;</span>
<span class="lineNum">     267 </span><span class="lineCov">         15 :   S.L = L;</span>
<span class="lineNum">     268 </span><span class="lineCov">         15 :   S.Z = Z;</span>
<span class="lineNum">     269 </span><span class="lineCov">         15 :   checkHeader(&amp;S);</span>
<span class="lineNum">     270 </span><span class="lineCov">          7 :   cl = luaF_newLclosure(L, LoadByte(&amp;S));</span>
<span class="lineNum">     271 </span><span class="lineCov">          7 :   setclLvalue(L, L-&gt;top, cl);</span>
<span class="lineNum">     272 </span><span class="lineCov">          7 :   luaD_inctop(L);</span>
<span class="lineNum">     273 </span><span class="lineCov">          7 :   cl-&gt;p = luaF_newproto(L);</span>
<span class="lineNum">     274 </span><span class="lineCov">          7 :   LoadFunction(&amp;S, cl-&gt;p, NULL);</span>
<span class="lineNum">     275 </span>            :   lua_assert(cl-&gt;nupvalues == cl-&gt;p-&gt;sizeupvalues);
<span class="lineNum">     276 </span>            :   luai_verifycode(L, buff, cl-&gt;p);
<span class="lineNum">     277 </span><span class="lineCov">          7 :   return cl;</span>
<span class="lineNum">     278 </span>            : }
<span class="lineNum">     279 </span>            : 
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.13</a></td></tr>
  </table>
  <br>

</body>
</html>
